package me.firstapp.repository.shop;

import java.util.Date;
import java.util.List;
import java.util.Map;

import me.firstapp.common.utils.Page;
import me.firstapp.module.shop.Order;
import me.firstapp.repository.base.EntityRepository;

public interface OrderRepository extends EntityRepository<Order> {

	Order findOrderByOrderNo(String orderNo, Long apiClientId);

	Order findOrderByMemberIdAndOrderNo(Long memberId, String orderNo, Long apiClientId);

	Page<Order> findOrderPage(Integer pageNo, Integer pageSize, Long memberId, Integer status, Long apiClientId);

	Page<Order> findOrderPage(Integer pageNo, Integer pageSize, Map<String, Object> searchParams, String sortParam,
			String sortType, Date startTime, Date endTime, Long apiClientId);

	List<Order> findOrders(Long memberId, Integer status, Long apiClientId);

	Long findPayedOrderCountsByPayTime(Date startTime, Date endTime, Long apiClientId);

	Double findPayedOrderPointsByPayTime(Date startTime, Date endTime, Long apiClientId);
}
